package com.hzh.blog.common.utils;

/**
 * 
 * @Author:1984
 * @Written by:
 * @Creation date: 2011-3-1 下午03:25:03
 * @Version: V1.0
 * @Description: 分页数据类
 */
public class SystemContext {
	
	private static ThreadLocal<Object> offsetPri = new ThreadLocal<Object>();
	private static ThreadLocal<Object> pagesizePri = new ThreadLocal<Object>();
	
	public static int getOffsetPri() {
		Integer _offsetPri = (Integer)offsetPri.get();
		if(_offsetPri == null){
			return 0;
		}
		return _offsetPri;
	}

	public static void setOffsetPri(int _offsetPri) {
		offsetPri.set(_offsetPri);
	}

	public static int getPagesizePri() {
		Integer _pagesizePri = (Integer)pagesizePri.get();
		if(_pagesizePri == null){
			return Integer.MAX_VALUE;
		}
		return _pagesizePri;
	}

	public static void setPagesizePri(int _pagesizePri) {
		pagesizePri.set(_pagesizePri);
	}
	
	public static void removePagesizePri(){
		pagesizePri.remove();
	}
	
	public static void removeOffsetPri(){
		offsetPri.remove();
	}
}
